home *** CD-ROM | disk | FTP | other *** search
- {$G+,X+}
-
- {Conditional defines that may affect this unit}
- {$I AWDEFINE.INC}
-
- {*********************************************************}
- {* ASCOPT.PAS 1.01 *}
- {* Copyright (c) TurboPower Software 1995 *}
- {* All rights reserved. *}
- {*********************************************************}
-
- unit Ascopt;
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, ExtCtrls, StdCtrls, Buttons, AdMisc, AdProtcl, TComIni;
-
- type
- TAsciiOptionsForm = class(TForm)
- GroupBox1: TGroupBox;
- ULCRHandlingBox: TRadioGroup;
- ULLFHandlingBox: TRadioGroup;
- GroupBox2: TGroupBox;
- StopOnCtlZBox: TCheckBox;
- Label1: TLabel;
- EOLCharEdit: TEdit;
- GroupBox3: TGroupBox;
- Label2: TLabel;
- DelayAfterCharEdit: TEdit;
- Label3: TLabel;
- DelayAfterLineEdit: TEdit;
- GroupBox4: TGroupBox;
- DLCRHandlingBox: TRadioGroup;
- DLLFHandlingBox: TRadioGroup;
- GroupBox5: TGroupBox;
- Label4: TLabel;
- EOFTimeoutEdit: TEdit;
- OkBtn: TBitBtn;
- CancelBtn: TBitBtn;
- HelpBtn: TBitBtn;
- procedure OkBtnClick(Sender: TObject);
-
- public
- constructor Create(AOwner : TComponent); override;
- end;
-
- implementation
-
- {$R *.DFM}
-
- constructor TAsciiOptionsForm.Create(AOwner : TComponent);
- begin
- inherited Create(AOwner);
-
- case UploadCR of
- aetNone : ULCRHandlingBox.ItemIndex := 0;
- aetStrip : ULCRHandlingBox.ItemIndex := 2;
- aetAddCRBefore: ULCRHandlingBox.ItemIndex := 0;
- aetAddLFAfter : ULCRHandlingBox.ItemIndex := 1;
- end;
-
- case UploadLF of
- aetNone : ULLFHandlingBox.ItemIndex := 0;
- aetStrip : ULLFHandlingBox.ItemIndex := 2;
- aetAddCRBefore: ULLFHandlingBox.ItemIndex := 1;
- aetAddLFAfter : ULLFHandlingBox.ItemIndex := 0;
- end;
-
- case DownloadCR of
- aetNone : DLCRHandlingBox.ItemIndex := 0;
- aetStrip : DLCRHandlingBox.ItemIndex := 2;
- aetAddCRBefore: DLCRHandlingBox.ItemIndex := 0;
- aetAddLFAfter : DLCRHandlingBox.ItemIndex := 1;
- end;
-
- case DownloadLF of
- aetNone : DLLFHandlingBox.ItemIndex := 0;
- aetStrip : DLLFHandlingBox.ItemIndex := 2;
- aetAddCRBefore: DLLFHandlingBox.ItemIndex := 1;
- aetAddLFAfter : DLLFHandlingBox.ItemIndex := 0;
- end;
-
- StopOnCtlZBox.Checked := StopCtrlZ;
-
- EOLCharEdit.Text := IntToStr(Byte(EolChar));
-
- DelayAfterCharEdit.Text := IntToStr(DelayChar);
- DelayAfterLineEdit.Text := IntToStr(DelayLine);
-
- EOFTimeoutEdit.Text := IntToStr(AscTimeout);
- end;
-
- procedure TAsciiOptionsForm.OkBtnClick(Sender: TObject);
- var
- E : Integer;
- W : Word;
- B : Byte;
-
- begin
- {validate EOL character input}
- Val(EOLCharEdit.Text, B, E);
- if (E = 0) then
- EolChar := Char(B);
-
- {validate inter-character delay input}
- Val(DelayAfterCharEdit.Text, W, E);
- if (E = 0) then
- DelayChar := W;
-
- {validate inter-line delay input}
- Val(DelayAfterLineEdit.Text, W, E);
- if (E = 0) then
- DelayLine := W;
-
- {validate end-of-file timeout message}
-
- case ULCRHandlingBox.ItemIndex of
- 0: UploadCR := aetNone;
- 1: UploadCR := aetAddLFAfter;
- 2: UploadCR := aetStrip;
- end;
-
- case ULLFHandlingBox.ItemIndex of
- 0: UploadLF := aetNone;
- 1: UploadLF := aetAddCRBefore;
- 2: UploadLF := aetStrip;
- end;
-
- case DLCRHandlingBox.ItemIndex of
- 0: DownloadCR := aetNone;
- 1: DownloadCR := aetAddLFAfter;
- 2: DownloadCR := aetStrip;
- end;
-
- case DLLFHandlingBox.ItemIndex of
- 0: DownloadLF := aetNone;
- 1: DownloadLF := aetAddCRBefore;
- 2: DownloadLF := aetStrip;
- end;
-
- StopCtrlZ := StopOnCtlZBox.Checked;
- end;
-
- end.
-
-